package com.ky.pro.java.rpc.demo.provider.controller;

import com.ky.pro.java.rpc.core.api.RpcfxRequest;
import com.ky.pro.java.rpc.core.api.RpcfxResponse;
import com.ky.pro.java.rpc.core.server.RpcfxInvoker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName InvokeController
 * @Description TODO
 * @Date 2022/1/1 14:36
 * @Author kevin
 **/
@RestController
public class InvokeController {

    @Autowired
    RpcfxInvoker invoker;

    @PostMapping("/")
    public RpcfxResponse invoke(@RequestBody RpcfxRequest request) {
        return invoker.invoke(request);
    }

}
